#include <stdio.h>

//a + aa + aaa + aaaa ......(n个)
int main()
{
    int a = 1;
    int n = 3;
    int sum = 0;
    int value = 0;
    for(int i = 0; i < n; i++)
    {
        value = 10 * value + a;
        sum += value;
    }
    printf("sum = %d\n",sum);
    return 0;
}